package ccgl.com.dao;

import java.sql.Connection;
import java.sql.SQLException;

import ccgl.com.dao.common.BaseDao;
import ccgl.com.factory.ConnectionFactory;
import ccgl.com.model.MUser;

public class XtszDao extends BaseDao<MUser> {

	/**
	 * 
	 * @param userId
	 * @param newPassword
	 * @return
	 */
	public boolean upDatePassword(String userId, String newPassword) {
		String sql = "update user set password='" + newPassword
				+ "' where id='" + userId + "'";
		Connection con = ConnectionFactory.getConnection();
		try {
			return update(sql, con) == 1;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				if (con != null) {
					con.close();
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return false;
	}

}
